<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>OA协同办公系统</title>
<link href="css/table.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/openwindow.js"></script>
<script type="text/javascript" src="js/table.js"></script>
<script type="text/javascript">
	function page(currentPage){
		$("#page").val(currentPage);
		document.pageForm.submit();
	}
	
	function nodesave(){
		var url="flowNode_init.action?flowId="+${flowId};
		openWindow(url,704,604);
	}

	function nodeupdate(taskId){
		var url="getFlowNodeById.action?nodeId="+taskId+"&flowId="+${flowId};
		openWindow(url,804,604);
	}

	function deletenode(){
		var arry="";
		var count=0;
		var checks = $("input[name='ids']");
		for(var i=0;i<checks.length;i++){
			if(checks[i].checked){
				if(arry==''){
				arry+="ids="+checks[i].value;
			}else{
				arry+="&ids="+checks[i].value;
			}
				count++;
			}
		}
		if(count==0){
			alert("请选择要删除的数据！");
			return;
		}
	if(confirm("确定要删除？")){
		$.post("deleteFlowNode.action",arry,function(data){
			if(data=="success"){
				alert("删除数据成功！");
				window.location.href="flowNodeManager.action?flowId="+${flowId};
			}else{
				alert("删除数据失败！");
			}
		});
	}
	}
	
	function transitionsave(flowid,nodeid){
		var url="nodeTransitionList.action?flowId="+flowid+"&nodeId="+nodeid;
		openWindow(url,504,404);
	}
	
</script>
</head>
<body>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="98%">
  <tbody>
  <tr>
    <td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
    <td style="background: url('image/wsoa_window_002.gif');"><table border="0" cellpadding="0" cellspacing="0">
      <tbody><tr>
        <td align="center" style="background: url('image/wsoa_window_002.gif');" width="10"><img src="image/center_19.gif"></td>
        <td align="center" style="background: url('image/wsoa_window_002.gif');"></td>
        <td>工作流程 &gt; 流程管理 &gt; 流程定义&gt;节点设置</td>
        </tr>
    </tbody>
    </table></td>
    <td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
  </tr>
  <tr>
    <td style="background: url('image/wsoa_window_010.gif');"  width="1">&nbsp;</td>
    <td>
    
		<table align="center" height="15" width="100%"><tbody><tr><td></td></tr></tbody></table>
	<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
		<tbody><tr>
			<td align="left" width="65%;"><span>	
			</span>
			</td>
			<td align="right" background="taskCx_files/wsoa_window_015.htm" width="40%">
			<span id="errorId"></span>
			<input class="button_02" name="b1" onclick="nodesave();" title="Add" value="增加" accesskey="a" type="button">		
			<input class="button_02" onClick="deletenode();" value="删除" title="Delete" accesskey="d" type="button">			
			</td>
		</tr>
	</tbody></table>
<!-- 按周 -->
<table width="100%">
<tbody><tr>
<td style="vertical-align: top;" width="72%">
<!-- 全部,流程设置 -->


<!--按日  -->
<table style="margin-top: 10px" id="tabllist" class="righ_list" frame="box" cellspacing="1" cellpadding="0" width="100%"  border="0">
<tbody>
<tr class="reigh_list2">
	<td width="5%"><input onclick="checkAll()"  type="checkbox" id="all" /></td>
	<td width="20%"  align="center">节点名称</td>
	<td   align="center">活动描述</td>
	<td   align="center" width="15%">活动类型</td>
	<td width="10%"  align="center">活动设置</td>
	<td width="5%" align="center">操作</td>
</tr>
<c:if test="${empty nodeList}">
<tr id="row">
	<td colspan="6">
		没有相关数据！
	</td>
</tr>
</c:if>
<c:forEach items="${nodeList}" var="node">
<tr id="row" onmouseover="overStyle(this)" onmouseout="outStyle(this)">
	<td width="24px">
	<input type="checkbox" name="ids" value="${node.id}" onclick="checkodd()" /></td>
	<td align="left">${node.name}</td>
	<td align="left">${node.content}</td>
	<c:if test="${node.status==0}">
		<td align="left">开始节点</td>
	</c:if>
	<c:if test="${node.status==1}">
		<td align="left">任务节点</td>
	</c:if>
	<c:if test="${node.status==2}">
		<td align="left">结束节点</td>
	</c:if>
	<td align="center"><a href="javascript:transitionsave('${node.flowId}','${node.id}');"><img alt="设置" src="image/standardpart.gif" border="0"/></a></td>
	<td align="center"><img alt="修改" onclick="nodeupdate('${node.id}')"  src="image/operate_update.gif" style="cursor: pointer"></td>
</tr>
</c:forEach>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>

     </td>
<td style="background: url('image/wsoa_window_006.gif');"  width="1">&nbsp;</td></tr>
  <tr>
    <td height="1" width="1"><img src="image/wsoa_window_009.gif" height="16" width="14"></td>
    <td style="background: url('image/wsoa_window_008.gif');" height="1"></td>
    <td height="1" width="1"><img src="image/wsoa_window_007.gif" height="16" width="12"></td>
  </tr>
</tbody>
</table>
</body>
</html>